package cpr.command;

import cpr.DefaultCommandHandler;
import cpr.context.SolveContext;

public class CmdSolutionContext extends DefaultCommandHandler {
	public CmdSolutionContext() {
		super("sol","initializes solve context to given wsId", null,null);
	}
	public void execute(String[] params) throws Exception {
		int wsId = getParameterInteger(params, 1,-1);
		if (wsId==-1) {
			throw new RuntimeException("provide valid wsId");
		}
		SolveContext sctx = getCommandContext().getContext().getCurrentWorksetContext().createSolveContext(wsId);
		getCommandContext().getContext().setCurrentSolveContext(sctx);
	}

}
